package cn.stronglink.oil.video;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.Toast;

import cn.stronglink.oil.R;
import co.ceryle.fitgridview.FitGridView;

import static com.tencent.bugly.beta.ui.h.v;


public class VideoListActivity extends AppCompatActivity {

    FitGridView gridView = null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_videolist);


        gridView = (FitGridView) findViewById(R.id.gridView);
        gridView.setFitGridAdapter(new VideoFitGridAdapter(this));

        // you can change grid view size any time. don't forget calling update method.
        changeSize(4, 3);
        gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                switch (position) {
                    case 0:

                        break;
                    case 1:
                        break;

                }
//                Toast.makeText(VideoListActivity.this,String.valueOf(position) + "aaa",Toast.LENGTH_LONG).show();
                startActivity(new Intent(VideoListActivity.this,RTMPActivity2.class));
            }
        });
    }

    private void changeSize(int r, int c) {
        gridView.setNumRows(r);
        gridView.setNumColumns(c);
        gridView.update();
    }
}